<?php 
/*
Template Name: Edit Product
*/
?>

<?php  ?>
<?php 


    if ( ! current_user_can( 'list_users' ) ) 
    {
      wp_die( __( 'bạn không có quyền truy cập trang này! ' ) );
      		global $id_sai_email;$status_pass;
            global $current_user;
            get_currentuserinfo();
    }//if ( ! current_user_can( 'list_users' ) ) 
    else {  
    	
 get_header();

            ?>
 

<div id="content_nano_three" class="clearfix" >
    
     <div id="breaum_suausser"> <h2>Sửa thông tin máy</h2> </div><!-- id="breaum_suausser" -->

		<div id="content"> <!-- class="edit_user-page" -->
			
                <div id='edit_may' style='margin-left:30px;'>
                	<?php 
                	$product_may = $wpdb->get_row("SELECT * FROM wp_may WHERE id_may = ".$_POST['edit_prod'], ARRAY_A);
                	?>
                			
                      <form id="your-profile" action='<?php bloginfo('url');?>/process-product' method="post">
								<input type="hidden" name="id_may" value='<?php  echo $product_may['id_may'];?>'>
								
							      <h3>Thông tin máy</h3>
									<table class="form-table">
										<tbody>
										<tr>
											<th scope="row"><span id="namzzdde_may">Tên máy</span></th>
											<td>
												<input style="font-weight: bold;padding: 3px;position: relative;left: -153px;margin-top: -1px;" type="text" name="name_may_edit" id="name_may_edit" value='<?php echo $product_may['name_may']?>' class="regular-text">
											</td>
										</tr>

									<!--
									<tr>
										<th><label for="first_name">Ảnh</label></th>
										<td><input type="text" name="image_may_url" id="image_may_url" value="<?php  echo $product_may['image_may_url']?>" class="regular-text"></td>
									</tr>
								   -->
									
									<tr>
										<!--
										<input type='hidden' name='image_may_url' id='image_may_url' value='<?php echo $product_may['image_may_url'] ?>'/>
										<th>
											<button for="image_may_url" style='padding:5px;color:#44484B;'>UpLoad ảnh</button>
										</th>
										<td>
											<img src="<?php echo get_bloginfo('template_directory').'/upload_may/'.$product_may['image_may_url']; ?>">
										</td>
									-->
											<p>
												<strong id='ten-anh'>Chọn ảnh</strong>
												<input id="xImagePath" name="ImagePath" type="text" size="60" value='<?php echo $product_may['image_may_url'] ?>' style='margin-top: 1px;float: left;margin-right: 13px;'/>
												<input type="button" value="upload" onclick="BrowseServer( 'Images:/', 'xImagePath' );" id='uploadlen'/>
											</p>
											<div id="preview" style="display:none">
												<strong>Selected Thumbnails</strong><br/>
												<div id="thumbnails"></div>
											</div>
									</tr>
									

									<tr>
										<th></th>
										<td><input type="hidden" name="ngay_tao" id="ngay_tao" value="<?php  echo $product_may['ngay_tao']?>" class="regular-text"></td>
									</tr>
									<tr>
										<th></th>
										<td><input type="hidden" name="ngay_sua" id="ngay_sua" value="<?php  echo $product_may['ngay_sua']?>" class="regular-text"></td>
									</tr>

									

									</tbody></table>

									<p class="submit"><input type="submit" name="submit_process" id="submit_process" class="button button-primary" value="Sửa thông tin máy"></p>

								</form>
           </div><!-- end div_form_edit-->


</div><!--- id="content" class="edit_user-page" -->
</div><!-- id="content_nano_three" -->

<?php } //elseif ( ! current_user_can( 'list_users' ) )  ?>
		
<?php get_footer(); ?>